import request from '@/utils/request'

// 查询维保工单列表
export function listOrder(params) {
  return request({
    url: '/org/work/order/list',
    method: 'get',
    params
  })
}

// 查询我的工单列表
export function myListOrder(params) {
  return request({
    url: '/org/work/order/myList',
    method: 'get',
    params
  })
}

// 查询维保工单详细
export function getOrder(id) {
  return request({
    url: '/org/work/order/' + id,
    method: 'get'
  })
}

// 获取用户列表
export const getOrderUserList = (id) => {
  return request({
    url: `/org/workOrder/record/informUserList/${id}`,
    method: 'get',
  })
}

// 获取维修人员列表
export const maintenanceUserList = (params) => {
  return request({
    url: `/org/user/maintenanceUser`,
    method: 'get',
    params
  })
}

// 工单操作记录
export const addOrderRecord = (data) => {
  return request({
    url: `/org/workOrder/record`,
    method: 'post',
    data
  })
}

// 工单操作记录动态列表
export const getOrderStepRecord = (params) => {
  return request({
    url: `/org/workOrder/record/list`,
    method: 'get',
    params
  })
}

// 获取项目列表
export const projectList = (params) => {
  return request({
    url: `/org/project/query/list`,
    method: 'get',
    params
  })
}

// 我的项目列表
export const myProjectList = (params) => {
  return request({
    url: `/org/work/order/myProjectList`,
    method: 'get',
    params
  })
}

// 获取工单评论列表
export const commentList = (id, params) => {
  return request({
    url: `/org/work/order/comment/list/${id}`,
    method: 'get',
    params
  })
}

// 新增工单评论列表
export const addComment = (data) => {
  return request({
    url: `/org/work/order/comment`,
    method: 'post',
    data
  })
}

// 获取工单附件列表
export const getWorkOrderAnnex = (id) => {
  return request({
    url: `/org/contract/annex/getWorkOrderAnnex/${id}`,
    method: 'get',
  })
}


// 查询任务大厅
export function orderTaskHall(params) {
  return request({
    url: '/org/work/order/taskHall',
    method: 'get',
    params
  })
}

// 查询任务大厅项目列表
export function orderTaskHallProjectList(params) {
  return request({
    url: '/org/work/order/taskHall/projectList',
    method: 'get',
    params
  })
}

// 查询任务大厅地区筛选条件
export function orderTaskHallRegion(params) {
  return request({
    url: '/org/work/order/taskHall/region',
    method: 'get',
    params
  })
}

// 获取维保工单待审核列表
export function orderExamineList(params) {
  return request({
    url: '/org/work/order/examineList',
    method: 'get',
    params
  })
}

// 查询工单审核项目列表
export function orderExamineProjectList(params) {
  return request({
    url: '/org/work/order/examineProjectList',
    method: 'get',
    params
  })
}

// 检测是否可操作工单
export function isOperate(params) {
  return request({
    url: `/org/work/order/isOperate`,
    method: 'get',
    params
  })
}